package com.totoro.rabbitmq.producer;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2017/9/14.
 */
@Service
public class SendService {
    @Resource
    private AmqpTemplate amqpTemplate ;
    /**
     * 简单的发送消息，将消息发送到queue队列
     * @param queue
     * @param msg
     */
    public void send(String queue, String msg){
        this.amqpTemplate.convertAndSend(queue,msg);
    }
}
